package Demo_8_28;

public class Demo10 {
    public static void main(String[] args) {
        String a= "hello java";
        String b= "hello java";

        if (a.equals(b)){

            String a1 = a.replaceAll(" +","");
            String b1 = b.replaceAll(" +","");


            System.out.println(a1.replaceAll("java","world"));
            System.out.println(b1.replaceAll("java","world"));
        }
    }
}
